<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@taglib prefix="s" uri="/struts-tags" %>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
  	<link rel="stylesheet" href="<%=request.getContextPath() %>/css/bootstrap.min.css" />
		<link rel="stylesheet" href="<%=request.getContextPath() %>/css/bootstrap-responsive.min.css" />
		<link rel="stylesheet"  href="<%=request.getContextPath() %>/css/select2.css" />
		<link rel="stylesheet" href="<%=request.getContextPath() %>/css/uniform.css" />
		<link rel="stylesheet" href="<%=request.getContextPath() %>/css/matrix-style.css" />
		<link rel="stylesheet" href="<%=request.getContextPath() %>/css/matrix-media.css" />
		<link href="<%=request.getContextPath() %>/font-awesome/css/font-awesome.css" rel="stylesheet" />
  	<script type="text/javascript" src="<%=request.getContextPath() %>/js/jquery.min.js"></script> 
		<script type="text/javascript" src="<%=request.getContextPath() %>/js/jquery.ui.custom.js"></script> 
		<script type="text/javascript" src="<%=request.getContextPath() %>/js/bootstrap.min.js"></script>
		<script type="text/javascript" src="<%=request.getContextPath() %>/js/jquery.uniform.js"></script> 
		<script type="text/javascript" src="<%=request.getContextPath() %>/js/select2.min.js"></script> 
		<script type="text/javascript" src="<%=request.getContextPath() %>/js/matrix.form_common.js"></script> 
  	<script type="text/javascript" src="<%=request.getContextPath() %>/js/lhgdialog/dialogUtilNew.js"></script>
		<script type="text/javascript" src="<%=request.getContextPath() %>/js/lhgdialog/lhgdialog.min.js?skin=iblue"></script>
		<link rel="stylesheet" href="<%=request.getContextPath() %>/js/validate/css/validate.css" type="text/css" media="all" />
		<script type="text/javascript" src="<%=request.getContextPath() %>/js/validate/talent-validate-all-min.js"></script>
  	<script type="text/javascript" src="<%=request.getContextPath() %>/js/jquery/plugin/jquery.form.js"></script>
		<script type="text/javascript">
			function saveAssessUserSet(){
				jQuery(".btn").attr("disabled", "disabled");
				jQuery("#assessUserForm").ajaxSubmit({
					url:"<%=request.getContextPath() %>/xtgl/assessuser/saveAssessUserSet.html",
					type:"post",
					dataType:"json",
					success:function(data){
						alertSuccess(data,refershParent());
						//alert(data,function(){
						//	refershParent();
						//});
					}
				});
			}
		</script>
  </head>
  <body>
			<div class="widget-box">
       <div class="widget-title"> <span class="icon"> <i class="icon-align-justify"></i> </span>
         <h5>用户关系维护</h5>
         <span class="label label-info">用户： ${model.user_nm}&nbsp;&nbsp;&nbsp;&nbsp;[&nbsp;${model.user_email}&nbsp;&nbsp;/&nbsp;&nbsp;${model.user_phone}&nbsp;]</span>
       </div>
       <div class="widget-content">
         <form action="/xtgl/assessuser/saveAssessUserSet.html" method="post" class="form-horizontal" id="assessUserForm">
         	  <input type="hidden" id="user_id" name="user_id" value="${model.user_id}"/>
	        	<div class="alert alert-info">
	             <button class="close" data-dismiss="alert">×</button>
	             <strong>Info!</strong> 为保证系统的安全性，若上/平/下级用户未存在该系统中，请先返回用户信息界面追加。   列表默认筛选为同一单位的用户。
	          </div>            
	          <div class="control-group">
              <label class="control-label">上级列表</label>
              <div class="controls">
	              <select multiple id="superior" name="superior" >
	              	<s:iterator value="relationList" id="s" >
	              		<option value="<s:property value="#s.user_id"/>"
	              		<s:if test="model.superior.indexOf(#s.user_id)!=-1">selected</s:if>	              		
	              		><s:property value="#s.user_info"/></option>
	              	</s:iterator>
	              </select>
              </div>
            </div>
           <div class="control-group">
             <label class="control-label">平级列表</label>
             <div class="controls">
	              <select multiple name="equal" id="equal">
	              	<s:iterator value="relationList" id="s" >
	              		<option value="<s:property value="#s.user_id"/>"
	              		<s:if test="model.equal!=null && #s.user_id !=null && model.equal.indexOf(#s.user_id)!=-1">selected</s:if>
	              		><s:property value="#s.user_info"/></option>
	              	</s:iterator>
	              </select>
             </div>
           </div>
           <div class="control-group">
             <label class="control-label">下属列表</label>
             <div class="controls">
	              <select multiple name="subordinate" id="subordinate">
	              	<s:iterator value="relationList" id="s" >
	              		<option value="<s:property value="#s.user_id"/>"
	              		<s:if test="model.subordinate.indexOf(#s.user_id)!=-1">selected</s:if>
	              		><s:property value="#s.user_info"/></option>
	              	</s:iterator>
	              </select>
             </div>
           </div>
           <div class="modal-footer">
           	<a href="#" class="btn" data-dismiss="modal" onclick="closeDialog();" >关闭</a>
           	<a href="#" id="add-event-submit" class="btn btn-primary" onclick="saveAssessUserSet();" >保存用户关系</a>
           </div>
         </form>
       </div>
		</div>
  </body>
</html>
